//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;

public class ExchangeGoodsSearch implements PickableBean {
    public static final String FN_ID = "id";
    public static final String FN_PAGE = "page";
    public static final String FN_PAGESIZE = "pageSize";
    public static final String FN_STATE = "state";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"id", "page", "pageSize", "state"});
    private String id;
    private Integer page;
    private Integer pageSize;
    private String state;

    public ExchangeGoodsSearch(String id, Integer page, Integer pageSize, String state) {
        this.setId(id);
        this.setPage(page);
        this.setPageSize(pageSize);
        this.setState(state);
    }

    public ExchangeGoodsSearch() {
    }

    public ExchangeGoodsSearch duplicate() {
        ExchangeGoodsSearch result = new ExchangeGoodsSearch();
        result.id = this.id;
        result.page = this.page;
        result.pageSize = this.pageSize;
        result.state = this.state;
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getId() {
        return this.id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public ExchangeGoodsSearch withId(String value) {
        this.setId(value);
        return this;
    }

    public ExchangeGoodsSearch withId(String value, String defaultValue) {
        this.setId(value == null ? defaultValue : value);
        return this;
    }

    public Integer getPage() {
        return this.page;
    }

    public void setPage(Integer value) {
        this.page = value;
    }

    public ExchangeGoodsSearch withPage(Integer value) {
        this.setPage(value);
        return this;
    }

    public ExchangeGoodsSearch withPage(Integer value, Integer defaultValue) {
        this.setPage(value == null ? defaultValue : value);
        return this;
    }

    public Integer getPageSize() {
        return this.pageSize;
    }

    public void setPageSize(Integer value) {
        this.pageSize = value;
    }

    public ExchangeGoodsSearch withPageSize(Integer value) {
        this.setPageSize(value);
        return this;
    }

    public ExchangeGoodsSearch withPageSize(Integer value, Integer defaultValue) {
        this.setPageSize(value == null ? defaultValue : value);
        return this;
    }

    public String getState() {
        return this.state;
    }

    public void setState(String value) {
        this.state = value;
    }

    public ExchangeGoodsSearch withState(String value) {
        this.setState(value);
        return this;
    }

    public ExchangeGoodsSearch withState(String value, String defaultValue) {
        this.setState(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case 3355:
                if (name.equals("id")) {
                    var3 = 0;
                }
                break;
            case 3433103:
                if (name.equals("page")) {
                    var3 = 1;
                }
                break;
            case 109757585:
                if (name.equals("state")) {
                    var3 = 3;
                }
                break;
            case 859428656:
                if (name.equals("pageSize")) {
                    var3 = 2;
                }
        }

        switch(var3) {
            case 0:
                return this.getId();
            case 1:
                return this.getPage();
            case 2:
                return this.getPageSize();
            case 3:
                return this.getState();
            default:
                return null;
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof ExchangeGoodsSearch) ? false : this.signature().equals(((ExchangeGoodsSearch)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean ExchangeGoodsSearch has no signature defined, no hash code or equals possible.");
    }
}
